Skip to content

feat: consolidate enable parameters to locals and fix invalid count bug #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 16, 2025

Conversation

RoseSecurity
Copy link
Contributor

@RoseSecurity RoseSecurity commented May 15, 2025

what

  • Move enabled logic into locals
  • Added a local: local.enabled && length(var.master_password) == 0

Note

length() returns an integer, so the result is always plan-time-known, even when the underlying string is deferred

  • Replaced the old count expression with count = module.this.enabled && local.is_master_password_empty ? 1 : 0.

why

  • Root cause: the count = module.this.enabled && var.master_password == "" ? 1 : 0 expression referenced var.master_password, which, when wired to something like aws_ssm_parameter.db_password.value, is unknown until apply time

references

@RoseSecurity RoseSecurity requested review from a team as code owners May 15, 2025 14:53
@RoseSecurity RoseSecurity requested review from Gowiem and nitrocode May 15, 2025 14:53
@mergify mergify bot added the triage Needs triage label May 15, 2025
@RoseSecurity RoseSecurity added the patch A minor, backward compatible change label May 15, 2025
@RoseSecurity RoseSecurity changed the title feat: consolidate enable parameters to locals feat: consolidate enable parameters to locals and fix invalid count bug May 15, 2025
@RoseSecurity
Copy link
Contributor Author

/terratest

@RoseSecurity RoseSecurity added the bugfix Change that restores intended behavior label May 15, 2025
@mergify mergify bot removed the triage Needs triage label May 16, 2025
@RoseSecurity RoseSecurity merged commit 3699e7f into main May 16, 2025
37 checks passed
@RoseSecurity RoseSecurity deleted the consolidate-enabled-flags-to-locals branch May 16, 2025 12:13
Copy link

These changes were released in v0.26.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Change that restores intended behavior patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants